Skip to content

Feature/red team remediation#37

Merged
Tanishq1030 merged 4 commits into
mainfrom
feature/red-team-remediation
Jul 12, 2026
Merged

Feature/red team remediation#37
Tanishq1030 merged 4 commits into
mainfrom
feature/red-team-remediation

Conversation

@Tanishq1030

Copy link
Copy Markdown
Member

No description provided.

…ings

Previously, evaluate_candidates() unconditionally set candidate severity to
'warning' for any process-execution finding that was static or lacked AI
influence -- completely ignoring the min_severity declared in the rule.

SEC-007 declares min_severity: 'error', so static subprocess.run([...])
calls were reported as WARNING, hiding BLOCKER-class shell injection beneath
most CI severity thresholds.

Fix: before downgrading, look up min_severity from every matching rule
config and clamp to the highest floor found.
Severity order: blocker(3) > error(2) > warning(1) > ignore(0).

Affects: SEC-007, FINOS-014, OWASP-002, RBI-018.
…tion

- Converted MIT-014-A (os.system/popen/spawn), MIT-014-B (subprocess), and MIT-010-A (eval/exec/pickle/marshal) from regex-based patterns to tree-sitter AST-based function_call rules.
- Extended cli.py to merge multiple function_call rules for the same canonical rule ID (like SEC-007) by building a list of allowed function names instead of clobbering.
- Enhanced cli.py's regex combining to safely strip (?i) flags from sub-patterns and prepend (?i) to the combined regex, preventing PatternErrors.
- Cleaned up Unicode decorative emojis from PolicyEngine verbose logs to prevent console encoding crashes on Windows (CP1252 environment).
- Updated MITIGATION_SHA256 hash constant in constitution.py to seal the updated catalog.
- Rewrote SpokeRelayClient and MockHubServer to utilize websockets library instead of raw TCP sockets.
- Aligned messages with Hub's authenticated handshake protocol: registers via SPOKE_REGISTER with regional key, awaits HUB_ACK, and processes real-time requests (FORENSIC_PULL, PING).
- Implemented AES-256-GCM symmetric encryption for forensic pull payloads using secret key matching the Hub's decryption protocol.
- Preserved backward compatibility with legacy test suite by offering dual-mapping on payload fields in mock server and decrypt/encrypt helpers.
- Added websockets dependency to requirements.txt.
Copilot AI review requested due to automatic review settings July 12, 2026 19:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Tanishq1030
Tanishq1030 merged commit 48e2904 into main Jul 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants